package ink.ykb.actDemo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import ink.ykb.actDemo.interceptors.LoginInterceptor;
import ink.ykb.actDemo.util.HttpRequestLocal;


@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter{

	@Autowired
	private HttpRequestLocal httpRequestLocal;

	/**
	 *	拦截器
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		
		registry.addInterceptor(new LoginInterceptor(httpRequestLocal))
			.addPathPatterns("/**");
		
	}


	
}
